package sc.core.dal.dataobject;

import java.util.ArrayList;

import sc.core.auth.enums.PermissionEnum;
import sc.core.auth.enums.RoleEnum;

public class UserInfoDO extends BaseDO {

	private static final long serialVersionUID = -8508648646310928233L;

	public UserInfoDO() {
	}

	public UserInfoDO(String userId, String userName, UserLoginDO userLoginDO,
			ArrayList<RoleEnum> roles, ArrayList<PermissionEnum> permissions) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.userLoginDO = userLoginDO;
		this.roles = roles;
		this.permissions = permissions;
	}

	String userId;

	String userName;

	UserLoginDO userLoginDO;

	ArrayList<RoleEnum> roles;

	ArrayList<PermissionEnum> permissions;

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public UserLoginDO getUserLoginDO() {
		return userLoginDO;
	}

	public void setUserLoginDO(UserLoginDO userLoginDO) {
		this.userLoginDO = userLoginDO;
	}

	public ArrayList<RoleEnum> getRoles() {
		if (roles == null)
			roles = new ArrayList<RoleEnum>();
		return roles;
	}

	public void setRoles(ArrayList<RoleEnum> roles) {
		this.roles = roles;
	}

	public ArrayList<PermissionEnum> getPermissions() {
		if (permissions == null)
			permissions = new ArrayList<PermissionEnum>();
		return permissions;
	}

	public void setPermissions(ArrayList<PermissionEnum> permissions) {
		this.permissions = permissions;
	}

	@Override
	public String toString() {
		return "UserInfoDO [userId=" + userId + ", userName=" + userName
				+ ", userLoginDO=" + userLoginDO + ", roles=" + roles
				+ ", permissions=" + permissions + "]";
	}

}
